#!/bin/bash

set -x
set -e

# SQL查询语句
SQL_QUERY="SELECT val from db.test where id=1"

eval $(mysql --skip-column-names -e "$SQL_QUERY" | awk '{print "VAL="$1}');

echo "VAL: $VAL"

curl -X DELETE "http://127.0.0.1:9999/test/$VAL"

set +x
set +e